From: Olaf Hering Date: Wed, 23 Sep 2020 06:48:40 +0000 (+0200) Subject: tools/libxc: report malloc errors in writev_exact X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~1574 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=0d8d289af7a679c028462c4ed5d98586f9ef9648;p=xen.git tools/libxc: report malloc errors in writev_exact The caller of writev_exact should be notified about malloc errors when dealing with partial writes. Signed-off-by: Olaf Hering Reviewed-by: Andrew Cooper Acked-by: Wei Liu --- diff --git a/tools/libs/ctrl/xc_private.c b/tools/libs/ctrl/xc_private.c index 8af96b1b7e..3fab94f9c0 100644 --- a/tools/libs/ctrl/xc_private.c +++ b/tools/libs/ctrl/xc_private.c @@ -721,6 +721,7 @@ int writev_exact(int fd, const struct iovec *iov, int iovcnt) if ( !local_iov ) { saved_errno = ENOMEM; + rc = -1; goto out; }